#! /usr/bin/env python3
#**************************************************************************************#
#     .--.                                                                             #
#    |o_o |                                                                            #
#    |:_/ |    Copyright (C) 2006 ~ 2011 Triductor Technology Inc.                     # 
#   //   \ \                All Rights Reserved Worldwide                              #
#  (|     | )                                                                          #
# /'\_   _/`\                                                                          #
# \___)=(___/                                                                          #
#**************************************************************************************#
#                                                                                      #
# Filename     : CmdBase.py
#                                                                                      #   
# Version      : $Revision: 1.0 $                                                      #
# Author       : Eric Lee (eric@triductor.com)                                         #
#                                                                                      #
# Created      : Thu Jun 23 09:37:07 2011
#                                                                                      #
# Module(s)    : Python 3                                                              #
#**************************************************************************************#
#--------------------------------------------------------#
# Description                                            #
#--------------------------------------------------------#
"""
    Parse the netlist to get the cells' hierarchical structure, 
and generate the cells list or force-operation file to initialize
cells for Gate-Level Simulation
"""

#--------------------------------------------------------#
# Revision                                               #
#--------------------------------------------------------#
__version__ = "$Revision: 1.0 $"

#--------------------------------------------------------#
# Import modules                                         #
#--------------------------------------------------------#
import argparse
import logging
#import os
#import sys
#import re
#import shutil
#import copy
#import tempfile
#import string
#import configparser
#import math
#import decimal
#from   elementtree import ElementTree as ET
#import multiprocessing as MP

#--------------------------------------------------------#
# Gloabl Variables Declarations                          #
#--------------------------------------------------------#

# create module-level logger
mlog        = logging.getLogger(__name__)

epilog      = ""

args_parser = argparse.ArgumentParser(
                description    = __doc__,
                epilog         = epilog,
                formatter_class= argparse.RawDescriptionHelpFormatter,
                add_help       = False,
                prog           =  'cmd base'
                )

args_parser.add_argument('source', nargs ='*',   help='Specify the input RTL file(s) to parse.' )

#--------------------------------------------------------#
# Class     Definition                                   #
#--------------------------------------------------------#
class CmdBase:
    """CmdBase"""
    def __init__(self, mlog, args=None):
        self.mlog   = mlog
        self.args   = None
        self.mlog.debug("Creating a   Command of " + self.__class__.__name__)

    def run(self, args=None):
        self.parse_args (args)
        self.pre_run    ()
        self.running    ()
        self.post_run   ()

    def parse_args(self,  args=None):
        self.mlog.debug("Paring Arguments :      " + str(args))
        self.args  = args_parser.parse_args(args)
                
    def pre_run(self):
        self.mlog.debug("Pre-Run  the Command of " + self.__class__.__name__)

    def running(self):
        self.mlog.debug("Running  the Command of " + self.__class__.__name__)

    def post_run(self):
        self.mlog.debug("Post-Run the Command of " + self.__class__.__name__)


#--------------------------------------------------------#
# Functions Definition                                   #
#--------------------------------------------------------#
#cmd = CmdBase()

#--------------------------------------------------------#
# main()    Definition                                   #
#--------------------------------------------------------#
def main():
    """The main process of program"""

    #--------------------------------------
    #Parse the arguments
    #--------------------------------------
    pass


#--------------------------------------------------------#
# Main  Process                                          #
#--------------------------------------------------------#
if __name__ == "__main__":
    main()



#**************************************************************************************#
# vim:noma:ft=python:fdm=marker:nowrap  
